<?php
session_start();
if ((isset ($_SESSION['auth'])) && ($_SESSION['auth']=="yes") && (isset ($_SESSION['admin'])) && ($_SESSION['admin']=="yes")){
header("location:admin_page.php");
}else if ((isset($_SESSION['auth'])) && ($_SESSION['auth']=="yes") && (isset($_SESSION['admin'])) && ($_SESSION['admin']=="no") && (isset($_SESSION['tutor'])) && ($_SESSION['tutor']=="no")){
header("location:ppal_profesor.php");
}else if ((isset($_SESSION['auth'])) && ($_SESSION['auth']=="yes") && (isset($_SESSION['admin'])) && ($_SESSION['admin']=="no") && (isset($_SESSION['tutor'])) && ($_SESSION['tutor']=="yes")) {
header("location:ppal_tutor.php");
}else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>home login</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<link href="../css/iexplorer_style.css" rel="stylesheet" type="text/css" />
<![endif]-->
</head>

<body>';

<?php
if(!(isset($_SESSION['error']))){
$_SESSION['error'] = "";
}
echo '
<div id="main">
<div class="login_step">
	<div id="login">
        <div class="login_container">
          <form id="loginform" name="loginform" method="post" action="login.php">
  <label>Nombre
                <input type="text" name="Nombre" id="Nombre" />
              </label>
              <label>Contraseña
                <input type="password" name="Password" id="Password" />
              </label>
            <label>
              <input type="submit" name="login" id="login2" value="Entrar" class="botonlogin" />
            </label>
          </form>
			<p style="color:#FF0000;">'.$_SESSION['error'].'</p>
        </div>
    </div>
</div>
</div>
<div id="footer">
    <div class="footer_container">
    Copyright © 2010 Colegio Montserrat . Todos los derechos reservados.
    </div>
</div>


</body>
</html>';
} ?>